﻿@using CodeGenerator.Core
@using System.Text
@{
    BuildHCodeCreate model = Model;
}
var keyValue = GetQuery('keyValue');
$(function () {
    initControl();
})
//初始化控件
function initControl() {
    if (keyValue) {
        GetAjax("/Framework/@(model.Name)/GetEntity?keyValue=" + keyValue, function (data) {
            SetWebControls(data);
        });
    } 
}
//保存表单
function AcceptClick() {

    if (!$('#form1').Validform()) {
        return false;
    }

    Loading(true, "正在提交数据...");
    window.setTimeout(function () {
        var postData = GetWebControls("#form1");
        AjaxJson("/Framework/@(model.Name)/Edit?keyValue=" + keyValue, postData, function (data) {
            tipDialog(data.message, data.type);
            if (data.type == 1) {
                CurrentIframe().windowload();
                closeDialog();
            }
        });
    }, 200);
}